package com.example.demo.controller;

import com.example.demo.entity.job.PrivateJob;
import com.example.demo.entity.major.MajorAll;
import com.example.demo.service.MajorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class MajorController {

    @Autowired
    private MajorService majorService;

    @GetMapping("/all")
    private List<MajorAll> lookAll(){
        return majorService.lookAll();
    }

    @GetMapping("/depart")
    private List<String> departType() {
        return majorService.departType();
    }

    @GetMapping("/private")
    private List<PrivateJob> getPrivate() {
        return majorService.getPrivate();
    }
}
